package luogu.rookie;

import java.util.Scanner;

//不高兴的津津
public class P1085_不高兴的津津 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int index = 0, max = 0;

        for (int i = 0; i < 7 ; i++) {
             int a = sc.nextInt();
             int b = sc.nextInt();
            if (a+b>max && a+b>8){
                max = a+b;
                index = i + 1;
            }
        }
        System.out.println(index);


    }

}
